.class public Lcom/example/location/SlideaniShowView;
.super Landroid/widget/FrameLayout;
.source "SlideaniShowView.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/example/location/SlideaniShowView$MyPageChangeListener;,
        Lcom/example/location/SlideaniShowView$MyPagerAdapter;,
        Lcom/example/location/SlideaniShowView$SlideShowTask;
    }
.end annotation


# static fields
.field private static final IMAGE_COUNT:I = 0x5

.field private static final TIME_INTERVAL:I = 0x5

.field private static final isAutoPlay:Z = true


# instance fields
.field private currentItem:I

.field private dotViewsList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/view/View;",
            ">;"
        }
    .end annotation
.end field

.field private handler:Landroid/os/Handler;

.field private imageViewsList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/widget/ImageView;",
            ">;"
        }
    .end annotation
.end field

.field private imagesResIds:[I

.field private scheduledExecutorService:Ljava/util/concurrent/ScheduledExecutorService;

.field private viewPager:Landroid/support/v4/view/ViewPager;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 83
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/example/location/SlideaniShowView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 85
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 87
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/example/location/SlideaniShowView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 89
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyle"    # I

    .prologue
    .line 91
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 67
    const/4 v0, 0x0

    iput v0, p0, Lcom/example/location/SlideaniShowView;->currentItem:I

    .line 72
    new-instance v0, Lcom/example/location/SlideaniShowView$1;

    invoke-direct {v0, p0}, Lcom/example/location/SlideaniShowView$1;-><init>(Lcom/example/location/SlideaniShowView;)V

    iput-object v0, p0, Lcom/example/location/SlideaniShowView;->handler:Landroid/os/Handler;

    .line 93
    invoke-direct {p0}, Lcom/example/location/SlideaniShowView;->initData()V

    .line 94
    invoke-direct {p0, p1}, Lcom/example/location/SlideaniShowView;->initUI(Landroid/content/Context;)V

    .line 96
    invoke-direct {p0}, Lcom/example/location/SlideaniShowView;->startPlay()V

    .line 99
    return-void
.end method

.method static synthetic access$0(Lcom/example/location/SlideaniShowView;)Landroid/support/v4/view/ViewPager;
    .locals 1

    .prologue
    .line 65
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->viewPager:Landroid/support/v4/view/ViewPager;

    return-object v0
.end method

.method static synthetic access$1(Lcom/example/location/SlideaniShowView;)I
    .locals 1

    .prologue
    .line 67
    iget v0, p0, Lcom/example/location/SlideaniShowView;->currentItem:I

    return v0
.end method

.method static synthetic access$2(Lcom/example/location/SlideaniShowView;)Ljava/util/List;
    .locals 1

    .prologue
    .line 61
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->imageViewsList:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$3(Lcom/example/location/SlideaniShowView;I)V
    .locals 0

    .prologue
    .line 67
    iput p1, p0, Lcom/example/location/SlideaniShowView;->currentItem:I

    return-void
.end method

.method static synthetic access$4(Lcom/example/location/SlideaniShowView;)Ljava/util/List;
    .locals 1

    .prologue
    .line 63
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->dotViewsList:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$5(Lcom/example/location/SlideaniShowView;)Landroid/os/Handler;
    .locals 1

    .prologue
    .line 72
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->handler:Landroid/os/Handler;

    return-object v0
.end method

.method private destoryBitmaps()V
    .locals 4

    .prologue
    .line 346
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    const/4 v3, 0x5

    if-lt v1, v3, :cond_0

    .line 354
    return-void

    .line 347
    :cond_0
    iget-object v3, p0, Lcom/example/location/SlideaniShowView;->imageViewsList:Ljava/util/List;

    invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    .line 348
    .local v2, "imageView":Landroid/widget/ImageView;
    invoke-virtual {v2}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    .line 349
    .local v0, "drawable":Landroid/graphics/drawable/Drawable;
    if-eqz v0, :cond_1

    .line 351
    const/4 v3, 0x0

    invoke-virtual {v0, v3}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 346
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method private initData()V
    .locals 1

    .prologue
    .line 117
    const/4 v0, 0x3

    new-array v0, v0, [I

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/example/location/SlideaniShowView;->imagesResIds:[I

    .line 125
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/example/location/SlideaniShowView;->imageViewsList:Ljava/util/List;

    .line 126
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/example/location/SlideaniShowView;->dotViewsList:Ljava/util/List;

    .line 128
    return-void

    .line 117
    nop

    :array_0
    .array-data 4
        0x7f0200a6
        0x7f0200a7
        0x7f0200a8
    .end array-data
.end method

.method private initUI(Landroid/content/Context;)V
    .locals 13
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 133
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v10

    const v11, 0x7f0300a0

    const/4 v12, 0x1

    invoke-virtual {v10, v11, p0, v12}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    .line 135
    new-instance v4, LPlugclass/ImageLoader;

    invoke-direct {v4, p1}, LPlugclass/ImageLoader;-><init>(Landroid/content/Context;)V

    .line 136
    .local v4, "imageLoader":LPlugclass/ImageLoader;
    invoke-virtual {v4}, LPlugclass/ImageLoader;->clearCache()V

    .line 137
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v6

    check-cast v6, Lmyapp/MyApp;

    .line 139
    .local v6, "m":Lmyapp/MyApp;
    const/4 v10, 0x1

    invoke-virtual {v4, v10}, LPlugclass/ImageLoader;->Yasuo(Z)V

    .line 140
    const/4 v10, 0x1

    invoke-virtual {v4, v10}, LPlugclass/ImageLoader;->showtype(I)V

    .line 141
    new-instance v3, Ldbclass/DBOpenHelper;

    invoke-direct {v3, p1}, Ldbclass/DBOpenHelper;-><init>(Landroid/content/Context;)V

    .line 142
    .local v3, "helper":Ldbclass/DBOpenHelper;
    invoke-virtual {v3}, Ldbclass/DBOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 143
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    const/4 v0, 0x0

    .line 144
    .local v0, "cursor":Landroid/database/Cursor;
    invoke-virtual {v3}, Ldbclass/DBOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v10

    .line 145
    const-string v11, "select * from appadv where type =\'3\'"

    const/4 v12, 0x0

    .line 144
    invoke-virtual {v10, v11, v12}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 146
    const-string v10, "animateslideshow"

    const-string v11, "\u83b7\u53d6\u533a\u57df\u6570\u636e"

    invoke-static {v10, v11}, Lmyapp/Mylog;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 147
    const/4 v5, 0x0

    .line 148
    .local v5, "k":I
    const v10, 0x7f0c006a

    invoke-virtual {p0, v10}, Lcom/example/location/SlideaniShowView;->findViewById(I)Landroid/view/View;

    move-result-object v8

    check-cast v8, Landroid/widget/LinearLayout;

    .line 150
    .local v8, "v_LinearLayout":Landroid/widget/LinearLayout;
    if-eqz v0, :cond_0

    .line 151
    :goto_0
    :try_start_0
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v10

    if-nez v10, :cond_3

    .line 189
    :cond_0
    if-eqz v0, :cond_1

    .line 190
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 192
    :cond_1
    if-eqz v1, :cond_2

    .line 193
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 204
    :cond_2
    :goto_1
    const v10, 0x7f0c0069

    invoke-virtual {p0, v10}, Lcom/example/location/SlideaniShowView;->findViewById(I)Landroid/view/View;

    move-result-object v10

    check-cast v10, Landroid/support/v4/view/ViewPager;

    iput-object v10, p0, Lcom/example/location/SlideaniShowView;->viewPager:Landroid/support/v4/view/ViewPager;

    .line 205
    iget-object v10, p0, Lcom/example/location/SlideaniShowView;->viewPager:Landroid/support/v4/view/ViewPager;

    const/4 v11, 0x1

    invoke-virtual {v10, v11}, Landroid/support/v4/view/ViewPager;->setFocusable(Z)V

    .line 207
    iget-object v10, p0, Lcom/example/location/SlideaniShowView;->viewPager:Landroid/support/v4/view/ViewPager;

    new-instance v11, Lcom/example/location/SlideaniShowView$MyPagerAdapter;

    const/4 v12, 0x0

    invoke-direct {v11, p0, v12}, Lcom/example/location/SlideaniShowView$MyPagerAdapter;-><init>(Lcom/example/location/SlideaniShowView;Lcom/example/location/SlideaniShowView$MyPagerAdapter;)V

    invoke-virtual {v10, v11}, Landroid/support/v4/view/ViewPager;->setAdapter(Landroid/support/v4/view/PagerAdapter;)V

    .line 208
    iget-object v10, p0, Lcom/example/location/SlideaniShowView;->viewPager:Landroid/support/v4/view/ViewPager;

    new-instance v11, Lcom/example/location/SlideaniShowView$MyPageChangeListener;

    const/4 v12, 0x0

    invoke-direct {v11, p0, v12}, Lcom/example/location/SlideaniShowView$MyPageChangeListener;-><init>(Lcom/example/location/SlideaniShowView;Lcom/example/location/SlideaniShowView$MyPageChangeListener;)V

    invoke-virtual {v10, v11}, Landroid/support/v4/view/ViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    .line 209
    return-void

    .line 165
    :cond_3
    :try_start_1
    sget-object v10, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "\u914d\u7f6e\u6587\u4ef6"

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "img"

    invoke-interface {v0, v12}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v12

    invoke-interface {v0, v12}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 166
    new-instance v9, Landroid/widget/ImageView;

    invoke-direct {v9, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 167
    .local v9, "view":Landroid/widget/ImageView;
    new-instance v10, Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v11

    invoke-static {v11}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "img"

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v11

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v4, v10, v9}, LPlugclass/ImageLoader;->DisplayImage(Ljava/lang/String;Landroid/widget/ImageView;)V

    .line 168
    sget-object v10, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v9, v10}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 169
    invoke-virtual {v9, v5}, Landroid/widget/ImageView;->setId(I)V

    .line 171
    iget-object v10, p0, Lcom/example/location/SlideaniShowView;->imageViewsList:Ljava/util/List;

    invoke-interface {v10, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 173
    new-instance v7, Landroid/view/View;

    invoke-direct {v7, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    .line 175
    .local v7, "myview":Landroid/view/View;
    invoke-virtual {v7, v5}, Landroid/view/View;->setId(I)V

    .line 176
    new-instance v10, Landroid/widget/FrameLayout$LayoutParams;

    const/16 v11, 0x8

    const/16 v12, 0x8

    invoke-direct {v10, v11, v12}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v7, v10}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 178
    const v10, 0x7f020050

    invoke-virtual {v7, v10}, Landroid/view/View;->setBackgroundResource(I)V

    .line 179
    invoke-virtual {v8, v7}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 181
    iget-object v10, p0, Lcom/example/location/SlideaniShowView;->dotViewsList:Ljava/util/List;

    invoke-interface {v10, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 182
    add-int/lit8 v5, v5, 0x1

    goto/16 :goto_0

    .line 186
    .end local v7    # "myview":Landroid/view/View;
    .end local v9    # "view":Landroid/widget/ImageView;
    :catch_0
    move-exception v2

    .line 187
    .local v2, "e":Ljava/lang/Exception;
    :try_start_2
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 189
    if-eqz v0, :cond_4

    .line 190
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 192
    :cond_4
    if-eqz v1, :cond_2

    .line 193
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    goto/16 :goto_1

    .line 188
    .end local v2    # "e":Ljava/lang/Exception;
    :catchall_0
    move-exception v10

    .line 189
    if-eqz v0, :cond_5

    .line 190
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 192
    :cond_5
    if-eqz v1, :cond_6

    .line 193
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 195
    :cond_6
    throw v10
.end method

.method private startPlay()V
    .locals 7

    .prologue
    .line 104
    invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadScheduledExecutor()Ljava/util/concurrent/ScheduledExecutorService;

    move-result-object v0

    iput-object v0, p0, Lcom/example/location/SlideaniShowView;->scheduledExecutorService:Ljava/util/concurrent/ScheduledExecutorService;

    .line 105
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->scheduledExecutorService:Ljava/util/concurrent/ScheduledExecutorService;

    new-instance v1, Lcom/example/location/SlideaniShowView$SlideShowTask;

    const/4 v2, 0x0

    invoke-direct {v1, p0, v2}, Lcom/example/location/SlideaniShowView$SlideShowTask;-><init>(Lcom/example/location/SlideaniShowView;Lcom/example/location/SlideaniShowView$SlideShowTask;)V

    const-wide/16 v2, 0x1

    const-wide/16 v4, 0x4

    sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    .line 106
    return-void
.end method

.method private stopPlay()V
    .locals 1

    .prologue
    .line 111
    iget-object v0, p0, Lcom/example/location/SlideaniShowView;->scheduledExecutorService:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V

    .line 112
    return-void
.end method
